package com.njust.controller;

import com.njust.common.ServerRespone;
import com.njust.form.FiveCompareForm;
import com.njust.form.TendencyForm;
import com.njust.service.TendencyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;
@RestController
@RequestMapping("/tendency")
@Api("趋势分析")
public class TendencyController {


    @Autowired
    private TendencyService tendencyService;

    @PostMapping("/history")
    @ApiOperation("历史趋势")
    public ServerRespone historyTendency(@RequestBody TendencyForm TendencyForm) throws ParseException {
        return tendencyService.historyTendency(TendencyForm);
    }


    @PostMapping("/fivecompare")
    @ApiOperation("五次对比")
    public ServerRespone fiveCompare(@RequestBody FiveCompareForm fiveCompareForm) throws ParseException {
        return tendencyService.fiveCompare(fiveCompareForm);
    }

}
